home *** CD-ROM | disk | FTP | other *** search
- property channel, buttonOut, buttonIn, repeatDelay, commandString, feedback
- global gButton
-
- on birth me, message, repeatSteps
- set commandString to message
- do("set feedback =" & commandString)
- if feedback = 1 then
- set state to #pressed
- set channel to the clickOn
- set buttonOut to the castNum of sprite channel
- set buttonIn to buttonOut + 1
- set gButton to me
- set the castNum of sprite channel to buttonIn
- puppetSprite(channel, 1)
- set repeatDelay to repeatSteps
- add(the actorList, me)
- end if
- end
-
- on stepFrame me
- if the mouseDown then
- if repeatDelay > 0 then
- set repeatDelay to repeatDelay - 1
- else
- do("set feedback =" & commandString)
- if feedback = 0 then
- death(me)
- end if
- end if
- else
- death(me)
- end if
- end
-
- on death me
- puppetSprite(channel, 0)
- deleteAt(the actorList, getPos(the actorList, me))
- set gButton to EMPTY
- end
-